package cn.iocoder.yudao.module.resource.controller.admin.material.vo;

import cn.iocoder.yudao.module.resource.enums.MaterialTypeEnum;
import cn.iocoder.yudao.module.resource.enums.AuditStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 资源素材创建/修改 Request VO
 *
 * @author 芋道源码
 */
@Schema(description = "管理后台 - 资源素材创建/修改 Request VO")
@Data
public class ResourceMaterialSaveReqVO {

    @Schema(description = "资源ID", example = "1024")
    private Long id;

    @Schema(description = "资源标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "精美头像")
    @NotBlank(message = "资源标题不能为空")
    @Size(max = 200, message = "资源标题长度不能超过200个字符")
    private String title;

    @Schema(description = "资源描述", example = "这是一个精美的头像素材")
    @Size(max = 500, message = "资源描述长度不能超过500个字符")
    private String description;

    @Schema(description = "资源类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "资源类型不能为空")
    @InEnum(value = MaterialTypeEnum.class, message = "资源类型必须是 {value}")
    private Integer type;

    @Schema(description = "缩略图URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://example.com/thumb.jpg")
    @NotBlank(message = "缩略图URL不能为空")
    @Size(max = 500, message = "缩略图URL长度不能超过500个字符")
    private String thumbnailUrl;

    @Schema(description = "原图URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://example.com/original.jpg")
    @NotBlank(message = "原图URL不能为空")
    @Size(max = 500, message = "原图URL长度不能超过500个字符")
    private String originalUrl;

    @Schema(description = "文件大小（字节）", example = "102400")
    private Long fileSize;

    @Schema(description = "图片宽度（像素）", example = "1920")
    private Integer width;

    @Schema(description = "图片高度（像素）", example = "1080")
    private Integer height;

    @Schema(description = "是否免费", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "是否免费不能为空")
    private Integer isFree;

    @Schema(description = "创作者ID", example = "1001")
    private Long creatorId;

    @Schema(description = "状态", example = "1")
    @InEnum(value = AuditStatusEnum.class, message = "状态必须是 {value}")
    private Integer status;

    @Schema(description = "审核备注", example = "审核通过")
    @Size(max = 500, message = "审核备注长度不能超过500个字符")
    private String auditRemark;

}
